package com.AQS.reetrantLockToAQS;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author 曾庆红
 * {@code @data} 2023-10-19 16:53
 */

public class TestReentrantLock {
    private static volatile int i = 0;

    public static void main(String[] args) {
        ReentrantLock lock = new ReentrantLock();
        new Thread(()->{
            lock.lock();
            try {
                TimeUnit.SECONDS.sleep(60*60*2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            lock.unlock();
        }).start();
        lock.lock();

        lock.unlock();
    }
}
